set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)

include_directories("C:/Program Files (x86)/OCCT/inc")
include_directories(${CMAKE_BINARY_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

link_directories("C:/Program Files (x86)/OCCT/win64/gcc/bin")
link_directories(${CMAKE_BINARY_DIR}/lib)

file(GLOB GUI_LIB_LISTS "C:/Program Files (x86)/OCCT/win64/gcc/bin/*.dll")
file(GLOB GUI_SOURCE_LISTS "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
file(GLOB GUI_INCLUDE_LISTS "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
file(GLOB GUI_GUIFILE_LISTS "${CMAKE_CURRENT_SOURCE_DIR}/*.ui")
file(COPY ${GUI_INCLUDE_LISTS} DESTINATION ${CMAKE_BINARY_DIR})

add_executable(magtwin ${GUI_SOURCE_LISTS} ${GUI_INCLUDE_LISTS} ${GUI_GUIFILE_LISTS} res.qrc)
target_link_libraries(magtwin PRIVATE Qt${QT_VERSION_MAJOR}::Widgets libmesh liblogger ${GUI_LIB_LISTS})


